import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
// import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
import {ElementPlusResolver} from 'unplugin-vue-components/resolvers'
import path from "path"
// https://vitejs.dev/config/
export default defineConfig({
    plugins: [vue(),
        AutoImport({
            resolvers: [ElementPlusResolver()],
        }),
        Components({
            resolvers: [ElementPlusResolver()],
        }),
    ],
    resolve: {
        alias: {
            // @符号表示为 src
            "@": path.resolve(__dirname, "./src")
        }
    },
    server: {
        port: "6789",
        // 配置跨域请求
        proxy: {
            '/aps': {
                target: 'http://114.55.37.219:9090',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/aps/, ''),
            }
        }
    }
})


